<template>
	<view>
		<view class="cu-list menu-avatar">
			<view class="cu-item bg-white myAvaCard">
				<view>头像</view>
				<view class="flex align-center">
					<image class="avatar" :src="userInfo.avatarUrl"></image>
					<text class="cuIcon-right changeAva"></text>
				</view>
			</view>
			<view class="cu-item bg-white myCard">
				<view>姓名</view>
				<view>{{userInfo.nickName}}</view>
			</view>
			<view class="cu-item bg-white myCard phoneCard">
				<view>电话号码</view>
				<view>15302892768
					<text class="cuIcon-right"></text>
				</view>
			</view>
			<view class="cu-item bg-white myCard">
				<view>公司</view>
				<view>部门</view>
			</view>
			<view class="cu-item bg-white myCard">
				<view>部门</view>
				<view>市场部</view>
			</view>
			<view class="cu-item bg-white myCard">
				<view>职位</view>
				<view>销售代表</view>
			</view>
			<view class="cu-item bg-white myCard">
				<view>周工作效率</view>
				<view>89.5</view>
			</view>
			
			
		</view>
		<view class="cu-bar bg-white solid-bottom margin-top">
			<view class="action">
				<text class="cuIcon-title text-orange "></text> 消息列表
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				userInfo:{},
				avatarUrl: ''
			}
		},
		beforeCreate() {
			uni.request({
			    // url: 'http://www.wayforever.top:8090/user/register', //仅为示例，并非真实接口地址。
				url: 'http://www.wayforever.top:8090/user/my',
				method: 'POST',
			    data: {
			        "openid": getApp().globalData.openId
			    },
			    success: (res) => {
					console.log(res)
			    },
				fail:(error) => {
					console.log(error)
				}
			});
		},
		created() {
			this.userInfo = getApp().globalData.userInfo
			avatarUrl = "src("+ this.userInfo.avatarUrl +")"
			console.log(avatarUrl)
		}
	}
</script>

<style>
	.myAvaCard,.myCard{
		justify-content: space-between !important;
		padding-left: 34rpx;
		font-family: 雅黑;
		color: #101010;
		font-weight: 500;
		font-size: 30rpx;
	}
	.myAvaCard{
		height: 124rpx !important;
		padding-right: 29rpx !important;
	}
	.myCard{
		height: 110rpx !important;
		padding-right: 34rpx !important;
	}
	.changeAva{
		padding-left: 15rpx;
	}
	.phoneCard{
		padding-right: 29rpx !important;
	}
</style>
